import $http from '../utils/request.js'

// 创建预览订单
export function createPreviewOrder(query) {
	return $http.httpRequest({
		url: '/orders/preview',
		methods:'POST',
		headers: 'application/json',
		data:query
	})
}

// 创建订单
export function createOrder(query) {
	return $http.httpRequest({
		url: '/orders/add',
		methods:'POST',
		headers: 'application/json',
		data:query
	})
}

// 订单列表
export function getOrderList(query) {
	return $http.httpRequest({
		url: '/orders/lists',
		data:query
	})
}

// 订单信息
export function getOrderDetail(query) {
	return $http.httpRequest({
		url: '/orders/detail',
		data: query
	})
}

// 取消订单
export function cancleOrder(query) {
	return $http.httpRequest({
		url: '/orders/cancel',
		methods:'POST',
		headers: 'application/json',
		data: query
	})
}

// 确认收货
export function confirmOrder(query) {
	return $http.httpRequest({
		url: '/orders/receive',
		methods:'POST',
		headers: 'application/json',
		data: query
	})
}